home *** CD-ROM | disk | FTP | other *** search
- KYOTO COMMON LISP UPDATE NOTICES
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: Full online documentation
-
- KCL is now equipped with online documentations for:
-
- all special forms
- all built-in macros
- all built-in functions
- all built-in variables and constants
- some built-in types
- some useful system internal functions
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: HELP and HELP* are added.
-
- These functions print online documentations onto the display.
-
- (HELP <symbol>) prints the documentation associated with <symbol>.
- (HELP) prints the greeting message to KCL beginners.
-
- (HELP* <string> <package>) prints the documentation associated
- with those symbols in the specified <package> whose print names
- contain <string> as substring. <string> may be a symbol, in which
- case the print-name of that symbol is used. <package> is optional and
- defaults to the LISP package. If <package> is NIL, then all packages
- are searched.
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: COMPILE-FILE now accepts two additional keyword parameters.
-
- If the value of the keyword parameter :LOAD is non-NIL, then COMPILE-FILE
- loads the generated fasl file after compilation. :LOAD defaults to NIL.
-
- If the value of the keyword parameter :MESSAGE-FILE is non-NIL, then
- compiler messages are logged into the file specified by this parameter.
- If the specified file already exists, then the messages are appended to the
- file. If not, a new file is created. :MESSAGE-FILE defaults to the value
- of the variable COMPILER:*DEFAULT-MESSAGE-FILE*.
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: COMPILE now deletes GAZONK files by default.
-
- If you want to save the intermediate GAZONK files, specify a non-NIL value
- as the keyword parameter :LEAVE-GAZONK to COMPILE. In case you do not
- want to specify the optional parameter <definition> to COMPILE, specify
- NIL. COMPILE now treats the NIL value as if <definition> was not specified.
- Thus, for example,
-
- (COMPILE 'FOO NIL :LEAVE-GAZONK T)
-
- compiles the function definition associated with FOO and leaves the
- intermediate GAZONK files.
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: LISTEN works in some versions.
-
- Try with your KCL.
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: The compiler does tail-recursion optimization.
-
- By default, the compiler replaces tail-recursive calls with iteration.
- You will occasionally receive the following compiler message.
-
- ;; Note: Tail-recursive call of FOO was replaced by iteration.
-
- There are two ways to prevent the compiler from doing this optimization.
-
- 1. Set COMPILER::*DO-TAIL-RECURSION* to NIL. No tail-recursion optimization
- is done while this variable has NIL value. Note that this variable is
- associated to an internal symbol in the COMPILER package.
-
- 2. Use NOT-INLINE declaration. Tail-recursive calls of the functions declared
- NOT-INLINE are not replace with iterations.
-
- Incidentally, the TAK example in Appendix B of KCL Report will get
- a better code:
-
- /* local entry for function TAK */
-
- static int LI1(V4,V5,V6)
- int V4,V5,V6;
- { VMB3 VMS3 VMV3
- TTL:;
- if((V5)<(V4)){
- goto T2;}
- VMR3(V6)
- T2:;
- {int V7;
- V7= LI1((V4)-1,V5,V6);
- {int V8;
- V8= LI1((V5)-1,V6,V4);
- V6= LI1((V6)-1,V4,V5);
- V5= V8;
- V4= V7;}}
- goto TTL;
- }
-
- which is equivalent to:
-
- /* local entry for function TAK */
-
- static int tak(x,y,z)
- int x,y,z;
- {
- loop: if(y<x) goto L;
- return(z);
- L:
- { int temp1=tak(x-1,y,z);
- int temp2=tak(y-1,z,x);
- z=tak(z-1,x,y);
- y=temp2;
- x=temp1;
- }
- goto loop;
- }
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: Now, the compiler always does error recovery.
-
- Thanks Bob, I have never noticed that the old compiler sometimes fails
- to recover from compile-time errors.
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: The pretty-printer became wiser.
-
- The number N as the SI:PRETTY-PRINT-FORMAT property of a symbol <symbol>
- indicates that, in the form (<symbol> <f1> ... <fN> <fN+1> ... <fM>),
- the subforms <fN+1>,...,<fM> are the 'body' of the form and thus are
- treated in a special way by the KCL pretty-printer.
-
- -----------------------
- Date: 86/5/17
- By: Taiichi
- Subject: Customizing the 'hole' size.
-
- The size of the hole between the heap and relocatable area (see Section
- 4.2 of the KCL Report) highly affects the performance of memory management.
- With the smaller size of hole, then garbage collection occurs more frequently,
- but the total size of the (logical) memory used by KCL is kept smaller.
- We added the following functions so that the user can set up the
- 'appropriate size' of his own.
-
- (SI:GET-HOLE-SIZE) returns as an integer the hole size (in pages).
- Note that this is NOT the size of the current hole, but IS the size
- of the hole immediately after each garbage collection.
-
- (SI:SET-HOLE-SIZE <fixnum>) sets the hole size. <fixnum> is the
- new size of the hole (in pages). <fixnum> must be a positive fixnum.
-
- To see how frequently the garbage collection occurs,
- set the variable SI:*GBC-MESSAGE* to a non-NIL value.
-
- -----------------------
- Date: 86/5/20
- By: Taiichi
- Subject: Variable bindings in LET, LET*, and COMPILER-LET
-
- According to CLtL, variable bindings in these special forms are given by
- the following syntax.
-
- ( { var | (var init) }* )
-
- However, UME-san hates this and requested (or forced ?) us to extend the
- syntax so that <init> be optional. Now, the syntax is:
-
- ( { var | (var [init]) }* )
-
- -----------------------
- Date: 86/5/20
- By: Taiichi
- Subject: A symbol is accepted as a defmacro-lambda-list.
-
- Again, UME-san requested us to make KCL accept a non-NIL symbol as a
- defmacro-lambda-list. KCL now regards
-
- (DEFMACRO <name> <symbol> . <body> )
-
- as equivalent to
-
- (DEFMACRO <name> (&REST <symbol>) . <body> )
-
- -----------------------
- Date: 86/5/30
- By: Taiichi
- Subject: Character I/O
-
- Now, PRIN1 prints some characters as
-
- #\\<octal digits>
-
- This indicates that PRIN1 does not know a good representation for these
- characers. For those KCL versions that use ASCII, those and only those
- characters whose codes are greater than 127 will be printed in this way.
-
- In accordance, the KCL reader accepts inputs in this format.
-
- >(code-char #o200)
- #\\200
-
- >(code-char #o100)
- #\@
-
- >(char-code #\\200)
- 128
-
- >#\\100
- #\@
-
- -----------------------
- Date: 86/5/30
- By: Taiichi
- Subject: &BODY parameter to DEFMACRO
-
- KCL now makes use of the pretty-printing information given by &BODY
- parameter to DEFMACRO. Accordingly, &REST and &BODY are not equivalent
- any more.
-
- For example, suppose we have defined a macro.
-
- (defmacro foo (x y &body z) ...)
-
- Then, the form
-
- (foo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- bbbbbbbbbbbbbbbbbbbbbbbbbb
- ccccccccccccccccccccc
- dddddddddddddddd
- eeeeeeeeeeeeeeeeeeeeeee)
-
- will be pretty-printed as:
-
- (foo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb
- ccccccccccccccccccccc
- dddddddddddddddd
- eeeeeeeeeeeeeeeeeeeeeee)
-
- But, if the macro definition uses &REST instead of &BODY, the same form
- will be prettey-printed as:
-
- (bar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb
- ccccccccccccccccccccc dddddddddddddddd eeeeeeeeeeeeeeeeeeeeeee)
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject: COMPILE-FILE accepts yet another keyword parameter.
-
- If the value of the keyword parameter :VERBOSE is non-NIL, then COMPILE-FILE
- prints what functions, macros, etc. are being compiled.
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject: The stepper accepts more commands.
-
- u Goes to the enclosing form.
- r FORM Evaluates the FORM and returns its value.
- b Backtrace
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject: Note on SYSTEM
-
- The function SYSTEM in KCL/Unix invokes sh rather than csh.
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject: COMPILE-FILE and COMPILE in KCL/VAX produces one more temporary file.
-
- In KCL/VAX, COMPILE-FILE and COMPILE produces a temporary assembler file
- with the filetype ".s". This file is automatically deleted after the
- compilation. Unlike the other temporary files, the user cannot specify
- the assembler file by keyword parameters to COMPILE-FILE and COMPILE.
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject: Notifying GBC
-
- There are C variables GBC_enter_hook and GBC_exit_hook, which hold
- the pointers to the functions to invoke respectively at the entry and
- at the exit of GBC. By defining his own functions, and by setting
- these variables, the user can do whatever he wants.
-
- Here is an example for you.
-
- % cat a.lsp
-
- (clines
- " /* Declare the global variables by yourself. */ "
- " int (* GBC_enter_hook) (); "
- " int (* GBC_exit_hook) (); "
- " "
- " /* The C function to call on entry of GBC */ "
- " my_gbc_entry () "
- " { "
- " printf(\"Sorry, I'm collecting garbages.\\n\"); "
- " fflush(stdout); "
- " } "
- " "
- " /* The C function to call on exit from GBC */ "
- " my_gbc_exit () "
- " { "
- " printf(\"Now, I continue your computation.\\n\");"
- " fflush(stdout); "
- " } "
- " "
- " /* The C function to set the global variables */ "
- " initialize_my_gbc_message () "
- " { "
- " GBC_enter_hook = my_gbc_entry; "
- " GBC_exit_hook = my_gbc_exit; "
- " } ")
-
- (defentry initialize-my-gbc-message ()
- "Sets the two C global variables."
- (void "initialize_my_gbc_message"))
-
- % kcl
- KCL (Kyoto Common Lisp)
-
- >(compile-file "a" :load t)
- ...
-
- >(initialize-my-gbc-message)
- nil
-
- >(dotimes (i 100) (make-list 1000))
- Sorry, I'm collecting garbages.
- Now, I continue your computation.
- Sorry, I'm collecting garbages.
- Now, I continue your computation.
- Sorry, I'm collecting garbages.
- Now, I continue your computation.
- Sorry, I'm collecting garbages.
- Now, I continue your computation.
- nil
-
- >
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject: Yet another break-level command.
-
- We added a break-level command :M (or :MESSAGE) which displays the
- error message.
-
- -----------------------
- Date: 86/6/30
- By: Taiichi
- Subject:
-
- Now, there is no limit of the number of characters for strings being read.
-
- -----------------------
- Date: 86/7/11
- By: Taiichi
- Subject: The break-level now rebinds *READTABLE*.
-
- Now, the break-level rebinds *READTABLE* on its entry. This is required
- when an KCL application clobbers the current readtable so much as to
- disable ordinary interaction within the break-level loop. A variable
- SI:*BREAK-READTABLE* was added to control the binding. If the value of
- this variable is NIL, then the break-level simply rebinds *READTABLE* to
- the current value of *READTABLE*. Otherwise, *READTABLE* will be bound to
- the value of this variable. Normally, the user, who wishes to use the
- standard readtable within the break-level loop, sets up this variable as:
-
- (SETQ SI:*BREAK-READTABLE* (COPY-READTABLE NIL))
-
- before, of course, entering the break-level loop. The initial value of
- SI:*BREAK-READTABLE* is NIL.
-
- -----------------------
- Date: 86/7/11
- By: Taiichi
- Subject: Break-level Commands
-
- The break-level has been revised for improvements. Type :H at the
- break-level loop and see the facilities available now.
-
- -----------------------
- Date: 86/7/11
- By: Taiichi
- Subject: (OPTIMIZE (SAFETY 3))
-
- The declaration (OPTIMIZE (SAFETY 3)) now directs the compiler to generate
- code so that each function call from the compiled code opens a CATCH frame
- with the name of the called function as the catch tag. Thus, at the
- break-level, the user can return any value(s) from any functions by
-
- (THROW <function-name> <value1> ... <valuen>)
-
- -----------------------
- Date: 86/7/11
- By: Taiichi
- Subject: Compiler Macros
-
-
- SI:DEFINE-COMPILER-MACRO [MACRO]
- <name> <lambda-list> {<decl> | <doc>}* <form>*
-
- Similar to DEFMACRO. However, SI:DEFINE-COMPILER-MACRO does not install the
- macro-expander function as the global macro definition of <name>. Rather,
- it only directs the KCL compiler to expand a form (<name> ... ) only at
- compile time. It never affects the function/macro cell of the symbol <name>,
- and ordinary function/macro definition (by DEFUN, DEFMACRO, etc.) does not
- affect the effect of SI:DEFINE-COMPILER-MACRO. Further more, the doc-string
- <doc>, even if supplied, is just ignored, and &BODY in the <lambda-list> does
- not affect the pretty printer.
- This macro is highly useful when porting Lisp applications written
- in Lisp dialects other than Common Lisp. See the description of
- SI:DEFINE-INLINE-FUNCTION below.
-
-
- SI:UNDEF-COMPILER-MACRO <name> [FUNCTION]
-
- Makes void the effect of (SI:DEFINE-COMPILER-MACRO <name> ... ).
- Note that this is a function but not a macro; Its argument is evaluated.
-
-
- SI:DEFINE-INLINE-FUNCTION [MACRO]
- <name> <lambda-list> {<decl> | <doc>}* <form>*
-
- This macro roughly corresponds to the DEFSUBST macro in ZetaLisp.
-
- (SI:DEFINE-INLINE-FUNCTION <name> (<var-1> ... <var-l>)
- <decl/doc-1> ... <decl/doc-m>
- <form-1> ... <form-n> )
-
- will be expanded into
-
- (PROGN
- (DEFUN <name> (<var-1> ... <var-l>)
- <decl/doc-1> ... <decl/doc-m>
- <form-1> ... <form-n> )
- (SI:DEFINE-COMPILER-MACRO <name> (<temp-1> ... <temp-l>)
- `(LET ((<var-1> ,<temp-1>) ... (<var-n> ,<temp-n>))
- <decl/doc-1> ... <decl/doc-m>
- <form-1> ... <form-m> )))
-
- Accordingly, there are some syntactic differences between
- SI:DEFINE-INLINE-FUNCTION forms and DEFUN forms. Some of the differences
- are:
-
- 1. The "lambda-list" should consist only of required variables.
- 2. The doc-string, if given, will be regarded as an ordinary string
- by the compiler (because LET does not accept doc-strings).
- As a result, declarations after the doc-string will cause a
- compile-time error.
- 3. The compiled code does not establish a block named <name> around
- the body. Thus, the behaviour of (RETURN-FROM <name>) in the
- compiled code might cause unexpected effects.
-
- As an example of the use of SI:DEFINE-INLINE-MACRO, let us define the
- function MEMQ.
-
- (SI:DEFINE-INLINE-FUNCTION MEMQ (X Y)
- (MEMBER X Y :TEST #'EQ))
-
- This form acutally defines MEMQ as a function. Thus, for example,
-
- (FUNCALL #'MEMQ 'A '(A B C)) ==> (B C)
-
- (FBOUNDP 'MEMQ) ==> (LAMBDA-BLOCK MEMQ (X Y) (MEMBER X Y :TEST #'EQ))
-
- On the other hand, the compiler expands the form
-
- (MEMQ (GIVE-ITEM) (GIVE-LIST))
-
- into
-
- (LET ((X (GIVE-ITEM)) (Y (GIVE-LIST)))
- (MEMBER X Y :TEST #'EQ))
-
- which the optimizer may then replace effectively with
-
- (MEMBER (GIVE-ITEM) (GIVE-LIST) :TEST #'EQ)
-
- or
-
- (DO ((X (GIVE-ITEM))
- (Y (GIVE-LIST) (CDR Y)))
- ((ENDP Y) NIL)
- (WHEN (EQ X (CAR Y)) (RETURN Y)))
-
- depending on the compilation mode.
-
- -----------------------
- Date:
- By:
- Subject:
- -----------------------
-